| 
 
 | 
 
 
 
 is a Unix system call that returns file attributes about an inode. The semantics of vary between operating systems. As an example, the Unix command ls uses it to retrieve information on (among many others): * atime: time of last access (), * mtime: time of last modification (), and * ctime: time of last status change (). statappeared in Version 1 Unix. It is among the few original Unix system calls to change, with Version 4's addition of group permissions and larger file size.==stat() functions== The C POSIX library header , found on POSIX and other Unix-like operating systems, declares the stat()functions, as well as related function calledfstat()andlstat(). The functions take astruct statbuffer argument, which is used to return the file attributes. On success, the functions return zero, and on error, −1 is returned and errno is set appropriately.The stat()andlstat()functions take a filename argument. If the file name is a symbolic link,stat()returns attributes of the eventual target of the link, whilelstat()returns attributes of the link itself. Thefstat()function takes a file descriptor argument instead, and returns attributes of the file that it identifies.The family of functions was extended to implement large file support. Functions named stat64(),lstat64()andfstat64()return attributes in astruct stat64structure, which represents file sizes with a 64-bit type, allowing the functions to work on files 2 GiB and larger. When the_FILE_OFFSET_BITSmacro is defined to 64, these 64-bit functions are available under the original names.The functions are defined as: int stat(const char *filename, struct stat *buf); int lstat(const char *filename, struct stat *buf); int fstat(int filedesc, struct stat *buf); 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Stat (system call)」の詳細全文を読む スポンサード リンク 
 
 |